package com.link2room.rodimus.entity;

import com.link2room.common.entity.BaseEntity;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * Created by LN on 2017/7/28.8:39
 */
@Entity
@Table(name = "coupon_good")
public class CouponGoodEntity extends BaseEntity{
    private String couponCode;
    private String goodCode;
    private String goodName;

    @Basic
    @Column(name = "good_name")
    public String getGoodName() {
        return goodName;
    }

    public void setGoodName(String goodName) {
        this.goodName = goodName;
    }

    @Basic
    @Column(name = "coupon_code")
    public String getCouponCode() {
        return couponCode;
    }

    public void setCouponCode(String couponCode) {
        this.couponCode = couponCode;
    }

    @Basic
    @Column(name = "good_code")
    public String getGoodCode() {
        return goodCode;
    }

    public void setGoodCode(String goodCode) {
        this.goodCode = goodCode;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        CouponGoodEntity that = (CouponGoodEntity) o;

        if (couponCode != null ? !couponCode.equals(that.couponCode) : that.couponCode != null) return false;
        if (goodCode != null ? !goodCode.equals(that.goodCode) : that.goodCode != null) return false;
        return goodName != null ? goodName.equals(that.goodName) : that.goodName == null;
    }

    @Override
    public int hashCode() {
        int result = couponCode != null ? couponCode.hashCode() : 0;
        result = 31 * result + (goodCode != null ? goodCode.hashCode() : 0);
        result = 31 * result + (goodName != null ? goodName.hashCode() : 0);
        return result;
    }
}
